<template>
  <div class="car-infor-pop">
    <div class="car-infor-pop-title">车辆信息</div>
    <div class="car-infor-pop-content">
      <div class="car-infor-pop-content-item" v-for="(item, index) in carInforPopData" :key="index">
        <span>{{ item.label }}</span>
        <span>{{ item.value }}</span>
        <img :src="item.icon" alt="" srcset="" v-if="item.icon" class="icon" />
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator'
@Component({
  name: 'car-infor-pop'
})
export default class CarInforPop extends Vue {
  @Prop({
    default: () => [
      {
        label: '线路名称：',
        value: '223路'
      },
      {
        label: '车牌号：',
        value: '桂A56203'
      },
      {
        label: '所属公司：',
        value: '白马市公交'
      },
      {
        label: '司机姓名：',
        value: '王德凯'
      },
      {
        label: '联系方式：',
        value: '16636202303'
      },
      {
        label: '载客数量：',
        value: '35人'
      },
      {
        label: '时速：',
        value: '40km/h'
      },
      {
        label: '下站到达：',
        value: '王哥庄（4秒）',
        icon: require('assets/images/situational-awareness/dingwei.png')
      },
      {
        label: '车载监控：',
        value: '人脸识别监控1',
        icon: require('assets/images/situational-awareness/jiankong.png')
      }
    ]
  })
  private carInforPopData!: any[]
}
</script>

<style lang="scss" scoped>
.car-infor-pop {
  box-sizing: border-box;
  width: 294px;
  height: auto;
  border-radius: 8px;
  background: rgba(1, 19, 67, 0.6);
  padding: 22px 20px 20px 20px;
  text-align: left;
  font-family: 'PingFang Regular';
  box-shadow: 0px 3px 20px 3px rgba(3, 125, 220, 0.7);
  &-title {
    font-size: 20px;
    font-weight: bold;
    height: 30px;
    line-height: 10px;
  }
  &-content {
    box-sizing: border-box;
    height: calc(100% - 30px);
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    &-item {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      width: 100%;
      // height: calc(100% / 9);
      height: 28px;
      position: relative;
      padding-left: 20px;
      &::after {
        content: '';
        display: block;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #0c81fe;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translate(0, -50%);
      }
      .icon {
        width: 16px;
        height: 16px;
        padding-left: 5px;
      }
    }
  }
}
</style>
